<?php
/**
 * 支付单业务逻辑处理
 * @access public
 * @copyright www.shopex.cn 2010.12.16
 * @author ome
 */
class omeauto_payments_payments{
	
	public function create_payments_after($sdf){
		$order_id = $sdf['order_id'];
		//如果有OME自动确认订单插件的话，会按照自动分确认规则来自动确认订单
        /*if($oAuto = kernel::service('do_autoconfirm')){
            if(method_exists($oAuto,'autoconfirm')){
                $oAuto->autoconfirm($sdf['order_id']);
            }
        }*/

		if($oAuto = kernel::service('do_autodispatch')){
			$objOrder = &app::get('ome')->model('orders');
			$order_sdf = $objOrder->dump($order_id,"*",array("order_objects"=>array("*",array("order_items"=>array("*")))));
			if($order_sdf['shipping']['is_cod'] == 'true' || $order_sdf['pay_status'] == '1'){
				if($order_sdf['process_status'] != "cancel"){
					if(method_exists($oAuto,'autodispatch')){
						$oAuto->autodispatch($order_sdf);
					}
				}
			}
        }
	}
    
}